const ws = {
  state:{
    devicebaseinfo:{},
    deviceparaminfo:{},
    deviceswitchinfo:{}
  },
  mutations:{
    SET_DEVICE_BASE_INFO:(state, devicebaseinfo) => {
      state.devicebaseinfo = devicebaseinfo
    },
    SET_DEVICE_PARAM_INFO:(state, deviceparaminfo)=>{
      state.deviceparaminfo = deviceparaminfo
    },
    SET_DEVICE_SWITCH_INFO:(state, deviceswitchinfo)=>{
      state.deviceswitchinfo = deviceswitchinfo
    }
  },
  actions:{
    setDeviceBaseInfo({commit},devicebaseinfo){
      return new Promise((resolve, reject) => {
        commit("SET_DEVICE_BASE_INFO",devicebaseinfo)        
      })
    },
    setDeviceParamInfo({commit},deviceparaminfo){
      return new Promise((resolve,reject)=>{
        commit("SET_DEVICE_PARAM_INFO",deviceparaminfo)
      })
    },
    setDeviceSwitchInfo({commit},deviceswitchinfo){
      return new Promise((resolve,reject)=>{
        commit("SET_DEVICE_SWITCH_INFO",deviceswitchinfo)
      })
    }
  }
}

export default ws;